package com.yidu.hbatsams.action.AtsSchemeAthlete;

import com.yidu.hbatsams.domain.AtsSchemeAthlete;
import com.yidu.hbatsams.service.AtsSchemeAthleteServicefx;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/atsathlete")
public class AtsSchemeAthleteActionfx {
    @Resource
    private AtsSchemeAthleteServicefx atsSchemeAthleteServicefx;

    @RequestMapping("/selectAll")
    @ResponseBody
    public Map<String,Object> findAll(@RequestParam("page") Integer pageNum,@RequestParam("limit")Integer pageSize,String schemeType){
       Map<String,Object> map  = new HashMap<>();
       //获取总行数
        System.out.println();
       int count = atsSchemeAthleteServicefx.count( schemeType);
       List<AtsSchemeAthlete> list = atsSchemeAthleteServicefx.findAll(pageSize,pageNum,schemeType);
       map.put("msg","");
       map.put("code",0);
       map.put("count",count);
       map.put("data",list);
        return map;
    }

}
